<script setup lang="ts">
import routerA from '@/router'

// 强烈建议使用composition Api
import { useRouter } from 'vue-router'
const routerB = useRouter()

console.log(routerB === routerA)
</script>

<template>
  <div>
    <button @click="routerA.push('/')">routerA</button>
    <button @click="routerB.push('/')">routerB</button>
  </div>
</template>

<style scoped></style>
